(function(){
	angular.module('app').factory('attrPoolComponentService', attrPoolComponentService);

	attrPoolComponentService.$inject = ['util','$q','atomicNotifyService'];

	function attrPoolComponentService(util,$q,atomicNotifyService){
		return {
			get: _get
		}

		/**
		 * [_get description]
		 * @param  {category:'',shopType:''} json [参数]
		 * @return [data]      [description]
		 */
		function _get(json){

			var defer = $q.defer();

			util.$get({
				url: '/marketconditions/property/getCategoryProperty.htm',
				data:json
			}).then(function(resp){

				if(resp.value.length== 0){
					atomicNotifyService.warning('该类目暂无数据');
					defer.reject([]);
					return; 
				}

				defer.resolve(resp.value);

			},function(err){

				defer.reject(err);

			});

			return defer.promise;
		}
	}
})();